// crowdfund/components/order/submit/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    goods_info: Object,
    submit: Object
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  attached() {
    setTimeout(() => {
      console.log(this.data.submit)
    }, 1000);
  },
  methods: {
    submitorder() {
      var _this = this
      var goods_id = _this.data.submit.goods_info.goods_id
      var attr_group_id = _this.data.submit.goods_info.attr[0].attr_group_id
      var attr_id = _this.data.submit.goods_info.attr[0].attr_id
      getApp().request({
        url: getApp().api.crowdfund.submit,
        method: "POST",
        data: {
          store_id: 1,
          r:"api/crowdfund/submit",
          address_id: _this.data.submit.address_id,
          offline: 0,
          is_peisong: 0,
          peisong_price: 0,
          content: _this.data.submit.content?'_this.data.submit.content':'',
          peisong_price: _this.data.submit.peisong_price,
          goods_info: '{"goods_id":' + goods_id + ',"num": 1,"attr": [{"attr_group_id": ' + attr_group_id + ',"attr_id": ' + attr_id + ',}]}',
          crowdfunding_goods_id: goods_id
        },
        success(res) {
          console.log(res)
        },

      })
    }
  }
})